package com.blog.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.blog.bean.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author 任浩
 * @version 1.0
 */

@Mapper
@Repository
public interface UserMapper extends BaseMapper<User> {
    /**
     * 检验用户名是否已存在
     * @param username
     * @return
     */
    List<User> checkUserName(@Param("username") String username);

    /**
     * 检验邮箱是否存在。
     * @param email
     * @return
     */
    List<User> checkEmail(@Param("email") String email);

    /**
     * 添加新用户
     * @param user
     */
    void add(User user);

    /**
     * 激活用户
     * @param user
     */
    void update(User user);

    /**
     * 验证账户密码成功
     * @param user
     * @return
     */
    User check(User user);

}
